package com.welsy.classroom.business
{
	import mx.rpc.IResponder;
	import mx.rpc.soap.WebService;
	import mx.rpc.AbstractOperation;
	import mx.rpc.AsyncToken;
	import com.adobe.cairngorm.business.ServiceLocator;
	
	public class GetClassComponentsDelegate
	{
		
		private var responder : IResponder;
		private var service : Object;
		
		public function GetClassComponentsDelegate(responder : IResponder) {
			this.responder = responder;
			this.service = ServiceLocator.getInstance().getWebService("ClassroomServices") as WebService;
		}
		
		public function getComponents(classId : int) : void {
			var op : AbstractOperation = service.getOperation("GetClassroomComponents");
			op.arguments.GetClassroomComponentsRequest.ClassroomId = classId;
			
			var token : AsyncToken = service.GetClassroomComponents();
			token.addResponder(responder);
		}
	}
}